package com.jie;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import javax.annotation.PostConstruct;

/**
 * Hello world!
 *
 */
@EnableTransactionManagement
@ServletComponentScan
@SpringBootApplication
public class UserServiceApplication {
    @Autowired
    private Environment env;
    public static void main( String[] args )
    {
        SpringApplication.run(UserServiceApplication.class, args);
    }
    @PostConstruct
    public void printConfig() {
        System.out.println("Server Port: " + env.getProperty("server.port"));
        System.out.println("Application Name: " + env.getProperty("spring.application.name"));
    }
}

